package cn.edu.ptu.jobfairs.basic.common;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * Created by Lin Chenxiao on 2020-03-05
 **/
@EqualsAndHashCode(callSuper = false)
@Data
public class ListResult<T> extends Result {
    private List<T> data;
    private Long total;
    public static ListResult EMPTY;
    static {
        EMPTY = new ListResult();
        EMPTY.total = 0L;
    }

    public static <T> ListResult<T> ok(List<T> data, Long total) {
        ListResult<T> r = new ListResult<>();
        r.data = data;
        r.total = total;
        return r;
    }
}
